package baza.games.airSoccer;

import android.graphics.Canvas;
import android.graphics.Color;
import android.graphics.Paint;

public class SoccerField implements IDrawableComponent{

	public void draw(Canvas canvas) {
		Paint paint = new Paint();
		paint.setColor(Color.GREEN);
		paint.setStrokeWidth(12);
		
		canvas.drawLine(0, 0, canvas.getWidth(), 0, paint); //topo
		canvas.drawLine(0, 0, 0, canvas.getHeight(), paint); //esquerda
		canvas.drawLine(0, canvas.getHeight(), canvas.getWidth(), canvas.getHeight(), paint);//baixo
		canvas.drawLine(canvas.getWidth(), 0, canvas.getWidth(), canvas.getHeight(), paint);//direta
		
		paint.setColor(Color.GRAY);
		paint.setStrokeWidth(2);
		
		float middleField = canvas.getHeight() / 2;
		canvas.drawLine(0, middleField, canvas.getWidth(), middleField, paint);
		
	
		String p1 = String.valueOf( AirSoccerEngine.placar1 );
		String p2 = String.valueOf( AirSoccerEngine.placar2 );
		
		
		paint.setColor(Color.BLUE);
		paint.setStrokeWidth(3);
		paint.setTextSize(100);
		
		canvas.drawText(p1, AirSoccerEngine.netWidth -100, AirSoccerEngine.netHeight/4, paint);
		paint.setColor(Color.RED);
		canvas.drawText(p2, AirSoccerEngine.netWidth -100, (3*AirSoccerEngine.netHeight)/4, paint);

		
	}

	public void update() {

	}

	public void setEngine(AirSoccerEngine engine) {
		// TODO Auto-generated method stub
		
	}

}
